package com.yaodian100.ec.order.service;

import java.util.ArrayList;
import java.util.Map;

import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.order.entity.Orders;

public interface OrderModifyService extends DomainService<Orders> {

	public final static String ERROR_ORDER_MODIFY_ADDRESS_Y3060N0020 = "Y3060N0020";// 是貨到付款,不是訂單審核中及等待配貨
	public final static String ERROR_ORDER_MODIFY_ADDRESS_Y50N1020 = "Y50N1020";// 是網上支付,不是等待付款中及等待配貨
	public final static String ERROR_ORDER_MODIFY_ADDRESS_Y40N20 = "Y40N20";// 是帳戶餘額,不是等待配貨
	public final static String ERROR_ORDER_MODIFY_ADDRESS_Y1020N1020_MIDEND = "Y1020N1020_midend";// 銀行or郵局轉帳,不是10等待付款及20等待配貨(中台)
	public final static String ERROR_ORDER_MODIFY_ADDRESS_Y1020N1020 = "Y1020N1020";// 銀行or郵局轉帳,不是10等待付款及20等待配貨
	public final static String ERROR_ORDER_MODIFY_PAYTYPE_Y3060N00 = "Y3060N00";// 是貨到付款,不是訂單審核中
	public final static String ERROR_ORDER_MODIFY_PAYTYPE_Y50N10 = "Y50N10";// 是網上支付,不是等待付款
	public final static String ERROR_ORDER_ORDER_NOT_EXISTS = "NON";// 訂單不存在
	public final static String ERROR_ORDER_MODIFY_SHIPFARE_NOO10 = "NOO10";// 不能修改運費
	public final static String ERROR_ORDER_MUSTPAY_BIGGER_VIRTUALBALANCE = "mustpay>virtualbalance";// 使用者帳戶余額 ＜ 訂單支付金額

	/**
	 * 修改订单支付方式
	 * 
	 * @param orderId
	 * @param logmsg
	 * @return
	 * @throws CoreException
	 */

	public ArrayList<String> updateOrderPaymentTp(String orderId, String paytype, boolean midendUse) throws Exception;

	public ArrayList<String> updateOrderPaymentTp(String orderId, String paytype, boolean midendUse, String memberId,
			String allowSplit) throws Exception;

	/**
	 * 修改收货人信息
	 * 
	 * @param orderId
	 * @param logmsg
	 * @return
	 * @throws CoreException
	 */
	public ArrayList<String> updateOrderAddres(String orderId, Map<String, Object> attrs) throws Exception;

	public void sendOrderModifyMail(String velocityTemplate, Orders order) throws CoreException;

	public Orders updateShipfare(String orderId, String newShipfare) throws CoreException;

}
